using System.ComponentModel.DataAnnotations;

namespace Universal.Application.Contracts.Dto.Auth;

/// <summary>
/// 注册用户Dto
/// </summary>
public class RegisterDto()
{
    [Required(ErrorMessage = "用户名不能为空")]
    public string Username { get; set; } = string.Empty;

    [Required(ErrorMessage = "密码不能为空")]
    public string Password { get; set; } = string.Empty;

    [Required(ErrorMessage = "请再次输入密码")]
    [Compare("Password", ErrorMessage = "两次密码不一致，请重新输入!!")]
    public string ConfirmPassword { get; set; } = string.Empty;

    [Required(ErrorMessage = "邮箱不能为空")]
    [RegularExpression(@"^[^\s@]+@[^\s@]+\.[^\s@]+$", ErrorMessage = "邮箱格式不正确，请重新输入!!")]
    public string Email { get; set; } = string.Empty;

}